<%@ page language="java" import="java.util.*" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8"%>
<div class="mask" style="display:none"></div>
<div class="maskLogin" style="display:none">
	<div class="responsive">
         <div class="row cl" style="margin-top:180px">
             <div class="col-md-3 col-md-offset-3" >  
	             <div class="panel shadow panel-default radius">
                    <div class="panel-body">
		                 <input  class="btn btn-secondary btn-block size-XL"  type="button" id="guestLoginBtn" value="游客登录"/>
                    </div>
                </div>              
             </div>
             <div class="col-md-3 ">                
                 <div class="panel shadow panel-default radius">
                    <div class="panel-body">
		                 <input  class="btn btn-success btn-block size-XL"  type="button" id="userLoginBtn" value="用户登录"/>
                    </div>
                </div> 
             </div>
         </div>
     </div>
</div>
<footer class="footer mt-20">
    <div class="container">
        <p>
        	京ICP备160494891号-2<br>
        	Copyright &copy;2016-2017 polls123.com All Rights Reserved. <br>
       		 <a href="http://weibo.com/u/1613423047?is_all=1" target="_blank">weibo@月夜山猫</a>
        </p>
    </div>
</footer>
<script>
$('#guestLoginBtn').on('click',function(){
	$(this).val("  游客登录中...  ");
	$(this).prop("disabled", true);
	$.ajax({
		type:'post',
		url:"/loginGuest",
		success:function(data){
			if(data.code==200){
				$.cookie('loginFailNum', 0);
				location.href=data.url;					
			}else if(data.code==400){
				layer.alert(data.desc);
			}else if(data.code==4001){
				layer.alert(data.desc);	
				layer.alert(data.desc,function(index, layero){
					layer.close(index);
					location.href=location.href;
				});
			}
		},
		error:function(){
			alert('guest login error');
		},
	});
});

$('#userLoginBtn').on('click',function(){
	location.href="/loginInit";
});
</script>
